package com.dianxin.smartpark.web.access;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.access.SmartParkAccessControlPassRecordQO;
import com.dianxin.smartpark.service.access.SmartParkAccessControlPassRecordService;
import com.dianxin.smartpark.service.vo.access.SmartParkAccessControlPassRecordVO;
import com.dianxin.sso.client.annotation.RecordLog;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 门禁记录
 * @author wangkai
 *
 *  app/mokua/xiaomok/action
 */
@RestController
@RequestMapping("/smartpark/access/passrecord")
public class SmartParkAccessControlPassRecordController {

    @Resource
    private SmartParkAccessControlPassRecordService smartParkAccessControlPassRecordService;

    /**
     * 获取门禁通行记录
     * @param qo qo
     * @return
     */
    @RequestMapping("/getPassRecords")
    @RecordLog(name = "获取门禁通行记录")
    @SaCheckPermission("/smartpark/access/passrecord/getPassRecords")
    public CommonResponseBody<List<SmartParkAccessControlPassRecordVO>> getPassRecords(@RequestBody SmartParkAccessControlPassRecordQO qo){

        return smartParkAccessControlPassRecordService.getPassRecords(qo);
    }


    /**
     * 保存门禁通行记录
     * @param vo
     * @return
     */
    @RequestMapping("/savePassRecord")
    public CommonResponseBody<Boolean> savePassRecord( @RequestBody SmartParkAccessControlPassRecordVO vo){

        return smartParkAccessControlPassRecordService.savePassRecord(vo);
    }

}
